<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="s"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
<c:set var="pageIndex" value="${page.getNumber() + 1}"></c:set>
<c:set var="totalPages" value="${page.getTotalPages()}"></c:set>
<c:set var="maxPages" value="5"></c:set>
<link href="<c:url value="/resources/css/common.css" />" rel="stylesheet">
<s:web pageName="seller_review">
<jsp:attribute name="headPart">
</jsp:attribute>
<jsp:body>
	<br/>
	<div style="text-align: right;">
		<ul class="pagination" style="margin: 0">
			<li><a href="#">${page.totalElements} 个车商</a></li>
			<li><a href="r?p=1">&laquo;</a></li>
			<c:forEach var="index" 
				begin="${pageIndex > maxPages ? pageIndex - maxPages : 1 }" 
				end="${totalPages - pageIndex > maxPages ? pageIndex + maxPages : totalPages}">
				
				<li <c:if test="${index eq pageIndex}">class="active"</c:if>>
					<a href="r?p=${index}">${index}</a>
				</li>
			</c:forEach>
			
			<li><a href="r?p=${totalPages}">&raquo;</a></li>
		</ul>
	</div>
	<ul>
		<c:forEach items="${page.getContent()}" var="i">
			<li>
				<div>
					<a href="d/${i.id}/${i.sellerName}">${i.sellerName}</a>
				</div>
			</li>
		</c:forEach>
	</ul>
	<div style="text-align: right;">
		<ul class="pagination" style="margin: 0">
			<li><a href="#">${page.totalElements} 个车商</a></li>
			<li><a href="r?p=1">&laquo;</a></li>
			<c:forEach var="index" 
				begin="${pageIndex > maxPages ? pageIndex - maxPages : 1 }" 
				end="${totalPages - pageIndex > maxPages ? pageIndex + maxPages : totalPages}">
				
				<li <c:if test="${index eq pageIndex}">class="active"</c:if>>
					<a href="r?p=${index}">${index}</a>
				</li>
			</c:forEach>
			
			<li><a href="r?p=${totalPages}">&raquo;</a></li>
		</ul>
	</div>
</jsp:body>
</s:web>
